package com.tmall.testgen.plugin.views.action;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jface.action.Action;

import com.tmall.testgen.client.commond.InfoReceiveListener;
import com.tmall.testgen.client.socket.SocketClient;
import com.tmall.testgen.common.bo.interact.back.InterceptInfo;
import com.tmall.testgen.plugin.Activator;

/**
 * 刷新action
 * 
 * @author star
 * 
 */
public class RefreshAction extends Action {
	private InfoReceiveListener listener;
	public RefreshAction(InfoReceiveListener listener) {
		super("刷新",Action.AS_CHECK_BOX);
		setToolTipText("refresh test");
		setImageDescriptor(ImageManeger.getImageDescriptor(ImageManeger.USED_REFRESH));
		this.listener = listener;
	}

	public void run() {
//		if(!SocketClient.getInstance().isStart())
//			return;
		InterceptInfo info = new InterceptInfo();
		info.setClassName("com.test.MyClassName");
		info.setMethodName("getmethodName");
		info.setMethodParamContent("int a,int b");
		List<Object> list= new ArrayList<Object>();
		list.add("参数c:1");
		list.add("参数b:2");
		info.setParams(list);
		info.setResult("结果：3");
		listener.addInterceptInfo(info);
	}
}
